﻿using SqlSugar;

namespace sixgod.Model
{
    public class ModelBase
    {
        [SugarColumn(IsPrimaryKey = true, IsOnlyIgnoreUpdate = true)]
        public virtual string Id { get; set; }

        /// <summary>
        /// 是否删除 0否 1是
        /// </summary>
        [SugarColumn(ColumnDescription = "是否删除 0否 1是")]
        public virtual int IsDelete{get;set;} = 0;

        /// <summary>
        /// 创建人
        /// </summary>
        [SugarColumn(ColumnDescription = "创建人", IsOnlyIgnoreUpdate = true)]
        public virtual string CreateUser { get; set; }

        /// <summary>
        /// 最后修改人
        /// </summary>
        [SugarColumn(ColumnDescription = "最后修改人", IsOnlyIgnoreUpdate = true)]
        public virtual string UpdateUser { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        [SugarColumn(ColumnDescription = "创建时间")]
        public virtual DateTime CreateTime { get; set; }

        /// <summary>
        /// 最后修改时间
        /// </summary>
        [SugarColumn(ColumnDescription = "最后修改时间")]
        public virtual DateTime UpdateTime { get; set; }

        public virtual void Create()
        {
            this.Id = Guid.NewGuid().ToString();
        }

    }
}